import { request } from '@/utils/request';

// 获取设备列表
export function getDevicesList(params) {
  return request({
    url: `/loading-user-work/get-device-info-list?userId=${params.userId}`,
    method: 'GET'
  });
}

// 上班
export function getToWork(data) {
  return request({
    url: '/loading-user-work/go-to-work',
    method: 'POST',
    data: data
  });
}
// 下班
export function getOffWork(data) {
  return request({
    url: `/loading-user-work/go-off-work?userId=${data.userId}`,
    method: 'GET'
  });
}

// 创建车辆黑名单
export function addBlackList(data) {
  return request({
    url: '/queue/blacklist-config/create',
    headers: {
      isToken: false
    },
    method: 'POST',
    data: data
  });
}
// 获得运单详情
export function getWaybillDetail(data) {
  return request({
    url: '/queue/waybill/get-waybill-by-waybillno',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}
// 获得操作记录
export function getRecordsData(data) {
  return request({
    url: '/queue/operate-recode/list',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}
// 排号-批量叫号
export function callupLineup(data) {
  return request({
    url: `/queue/lineup-info-mgr/batch-artificial-call-number`,
    headers: {
      isToken: false
    },
    method: 'PUT',
    data: data
  });
}
// 停车场-批量叫号
export function callupParking(data) {
  return request({
    url: `/parking/queue-info/batch-artificial-call-number`,
    headers: {
      isToken: false
    },
    method: 'PUT',
    data: data
  });
}
// 获得排号容量
export function getLineupCapacityData(data) {
  return request({
    url: '/queue/corp-queue-config/get-list',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}
// 获得停车场容量
export function getParkingCapacityData(data) {
  return request({
    url: '/parking/capacity/list',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}

// 获得装卸货地
export function getLoadsListsPage() {
  return request({
    url: '/queue/load-site-mgr/get-simple-list',
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
// // 获得客户列表
// export function getCustListsPage() {
// 	return request({
// 		url: '/queue/cust-mgr/get-simple-list',
// 		headers: {
// 			isToken: false
// 		},
// 		'method': 'GET',
// 	})
// }
// 获得供应商列表
export function getCustListsPage() {
  return request({
    url: '/queue/cust-mgr/get-supplier-simple-list',
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
// // 获得煤种列表
// export function getCornameListsPage() {
// 	return request({
// 		url: '/queue/coal-type-mgr/get-simple-subtype-list',
// 		headers: {
// 			isToken: false
// 		},
// 		'method': 'GET',
// 	})
// }
// 获得采购煤种列表
export function getCornameListsPage() {
  return request({
    url: '/queue/coal-type-mgr/get-purchase-simple-subtype-list',
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}

// 排号-作废
export function lineupInvalid(ids) {
  return request({
    url: `/queue/lineup-info-mgr/invalid?id=${ids}`,
    headers: {
      isToken: false
    },
    method: 'PUT'
  });
}
// 排号-手动叫号
export function lineupCalled(ids) {
  return request({
    url: `/queue/lineup-info-mgr/lineup-called?id=${ids}`,
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
// 停车场-叫号挂起
export function parkingSuspend(ids) {
  return request({
    url: `/parking/queue-info/suspend?id=${ids}`,
    headers: {
      isToken: false
    },
    method: 'PUT'
  });
}

// 停车场-叫号作废
export function parkingInvalid(ids) {
  return request({
    url: `/parking/queue-info/invalid?id=${ids}`,
    headers: {
      isToken: false
    },
    method: 'PUT'
  });
}

// 停车场-手动叫号
export function parkingCallNumber(ids) {
  return request({
    url: `/parking/queue-info/artificial-call-number?id=${ids}`,
    headers: {
      isToken: false
    },
    method: 'PUT'
  });
}
